package o;

import androidx.annotation.NonNull;
import com.huawei.appgallery.serverreqkit.api.bean.ResponseBean;
import com.huawei.hms.framework.network.restclient.hianalytics.HianalyticsData;

public class cwe extends esh {
    public static void ˊ(ResponseBean responseBean, BaseRequest o_cvu) {
        int responseCode = responseBean.getResponseCode();
        int rtnCode_ = responseBean.getRtnCode_();
        int httpStatusCode = responseBean.getHttpStatusCode();
        if (responseCode != 0 || rtnCode_ != 0) {
            String str = "";
            if (responseCode != 0) {
                str = ॱ(responseBean, responseCode);
                if (httpStatusCode == ResponseBean.NOT_FOUND) {
                    responseBean.setDnsFailType(ResponseBean.NOT_FOUND);
                }
            } else if (rtnCode_ != 0) {
                str = (rtnCode_ == 1022 || rtnCode_ == 1021 || rtnCode_ == 1012 || rtnCode_ == 1011) ? String.valueOf(rtnCode_) : ˎ(rtnCode_);
            }
            ˏ(str, ((o_cvu.getMethod_() + "_" + BaseRequest.getReqUrl(o_cvu) + "_" + doo.ˋॱ(ContentManager.getInstant().getContext()) + "_" + (responseBean.isDnsReachable() ? "1" : "0") + "_" + responseBean.getDnsFailType()) + "_") + responseBean.getErrCause().name().replace("_", ""));
        }
    }

    @NonNull
    private static String ॱ(ResponseBean responseBean, int i) {
        switch (i) {
            case 2:
                return "10002";
            case 3:
                return "10001";
            case 4:
                return "10003";
            default:
                int httpStatusCode = responseBean.getHttpStatusCode();
                if (httpStatusCode == 200 || httpStatusCode == -1) {
                    return ॱ(i);
                }
                return "10004_" + httpStatusCode;
        }
    }

    private static String ˎ(int i) {
        return "10005_" + i;
    }

    private static String ॱ(int i) {
        return "10006_" + i;
    }

    private static void ˏ(String str, String str2) {
        ese.ˋ(esd.ˊ(cwe.class), str, str2);
    }

    protected String[] ˊ() {
        return new String[]{HianalyticsData.ERROR_CODE, "error_desc"};
    }

    public String ˏ() {
        return cdj.ˏ() + "000";
    }
}
